function span2XFBML(id, tagname) {
	var xfbmlTag = document.createElement("fb:" + tagname);
	for (var i = 2; i < arguments.length; i++) {
		var attName = arguments[i];
		var attValue = arguments[++i];
		xfbmlTag.setAttribute(attName, attValue);
	}
	var span = document.getElementById(id);
	span.parentNode.replaceChild(xfbmlTag, span);
}
